package com.shop.api.feign;

import com.shop.Result.LdbzResult;
import com.shop.pojo.LdbzCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "shop-service-admin")
public interface AdminCategoryFeign {

    //修改页面跳转
    @RequestMapping(value = "/admin/category/service/editCategory/{id}",method = RequestMethod.GET)
    LdbzResult editCategory(@RequestParam("id")long id);

    //获取分类信息
    @RequestMapping(value = "/admin/category/service/getCategoryList",method = RequestMethod.GET)
    LdbzResult getCategoryList(@RequestParam("entity") LdbzCategory entity);

    //分页获取产品分类
    @RequestMapping(value = "/admin/category/service/getCategoryPage",method = RequestMethod.GET)
    LdbzResult getCategoryPage(@RequestParam("entity") LdbzCategory entity,@RequestParam("page") int page,@RequestParam("limit") int limit);

    //删除产品分类
    @RequestMapping(value = "/admin/category/service/deleteByKey/{id}",method = RequestMethod.GET)
    LdbzResult deleteByKey(@RequestParam("id") String id);

    //新增产品分类
    @RequestMapping(value = "/admin/category/service/insertByEntity",method = RequestMethod.GET)
    LdbzResult insertByEntity(@RequestParam("entity") LdbzCategory entity);

    //修改产品分类
    @RequestMapping(value = "/admin/category/service/updateByKey",method = RequestMethod.GET)
    LdbzResult updateByKey(@RequestParam("entity") LdbzCategory entity);

    //根据父节点获取其子元素
    @RequestMapping(value = "/admin/category/service/updateByKey",method = RequestMethod.GET)
    LdbzResult getCategoryTree(@RequestParam("fid") long fid);

    //更新分类的排序
    @RequestMapping(value = "/admin/category/service/updateByKey",method = RequestMethod.GET)
    LdbzResult updateSort(@RequestParam("ids") String ids);

    @RequestMapping(value = "/admin/category/service/countAdminUser",method = RequestMethod.GET)
    LdbzResult countAdminUser(@RequestParam("entity") LdbzCategory entity);
}
